#include <iostream>
#include"head.h"
void* InputEmployee()//录入职工数据
{
    Employee* E  =  (Employee*)malloc(sizeof(Employee)); 

	//职工信息
	fflush (stdin);
	printf ("\n姓名:");
	gets(E->name);/**/
	printf ("\n性别:");
//	gets(E->gender);

	while (1)
	{
		char judge[3];
		fflush (stdin);
		gets(judge);
		if(strcmp(judge, "男") == 0 ||strcmp(judge, "女") == 0 )
		{
			strcpy(E->gender,judge);
			break;
		}
		else
		{
			printf("性别输入错误，重新输入男或女\n");
		}
	}

	printf ("\n出生日期:");
	gets(E->birthday);
	printf ("\n参加工作日期:");
	gets(E->startworkdate);
	printf ("\n所属部门:");
	gets(E->department);
	printf ("\n人员类别:");
	gets(E->personnel_category);
	printf ("\n技术等级:");
	scanf("%d", &E->technical_grade);
	fflush (stdin);
	printf ("\n技术职称:");
	gets(E->technical_titles);
	printf ("\n文化程度:");
	gets(E->degree_of_educaation);
	printf ("\n民族:");
	gets(E->nation);
	printf ("\n籍贯:");
	gets(E->native__please);
	printf ("\n现住址:");
	gets(E->present_adress);


	//职工工资补贴
	printf("\n基本工资:");
	scanf ("%lf", &E->base_pay);
	printf("\n岗位津贴:");
	scanf ("%lf", &E->job_subisidy);
	printf("\n物价补贴:");
	scanf ("%lf", &E->escalsting_wage);
	printf("\n职务津贴:");
	scanf ("%lf", &E->wage_sttached_to_a_post);
	printf("\n住房补贴:");
	scanf ("%lf", &E->housing_add);
	printf("\n房租:");
	scanf ("%lf", &E->chummage);
	printf("\n加班费:");
	scanf ("%lf", &E->ovrtime_pay);
	printf("\n夜班费:");
	scanf ("%lf", &E->night_duty_allowance);
	printf("\n病假扣款:");
	scanf ("%lf", &E->sick_leave_deduction);
	printf("\n事假扣款:");
	scanf ("%lf", &E->personal_leave_deduction);
	printf("\n旷工扣款:");
	scanf ("%lf", &E-> absenteism_deduction);
	printf("\n其它扣款:");
	scanf ("%lf", &E-> other_deductions);
	
	//职工出勤
	printf("\n职工的出勤日数:");
	scanf ("%d", &E->attendance_days);
	printf("\n公伤日数:");
	scanf ("%d", &E->injured_days);
	printf("\n产假日数:");
	scanf ("%d", &E->materniy_leave_days);
	printf("\n病假日数:");
	scanf ("%d", &E->Sick_days);
	printf("\n旷工日数:");
	scanf ("%d", &E->absenteism_days);
	printf("\n事假日数:");
	scanf ("%d", &E->personal_leave_dayds);
	printf("\n加班日数:");
	scanf ("%d", &E->ovrtime_days);
	printf("\n夜班日数:");
	scanf ("%d", &E->night_duty_days);
	printf("\n病假系数:");
	scanf ("%d", &E->sick_leave_coefficient);
	
	return (void*)E;//返回数据域
} 

void ShowEmployee(void* data)
{//显示职工数据
	Employee* E = (Employee*)data; 
	
	//职工信息
	printf ("\n姓名:%s", E->name); 
	printf ("\n性别:%s", E->gender);
	printf ("\n出生日期:%s", E->birthday);
	printf ("\n参加工作日期:%s", E->startworkdate);
	printf ("\n所属部门:%s", E->department);
	printf ("\n人员类别:%s", E->personnel_category);
	printf ("\n技术等级:%d", E->technical_grade);
	printf ("\n技术职称:%s", E->technical_titles);
	printf ("\n文化程度:%s", E->degree_of_educaation);
	printf ("\n民族:%s", E->nation);
	printf ("\n籍贯:%s", E->native__please);
	printf ("\n现住址:%s", E->present_adress);
	
	//职工工资补贴
	printf("\n基本工资:%lf", E->base_pay);
	printf("\n岗位津贴:%lf", E->job_subisidy);
	printf("\n物价补贴:%lf", E->escalsting_wage);
	printf("\n职务津贴:%lf", E->wage_sttached_to_a_post);
	printf("\n住房补贴:%lf", E->housing_add);
	printf("\n房租:%lf", E->chummage);
	printf("\n加班费:%lf", E->ovrtime_pay);
	printf("\n夜班费:%lf", E->night_duty_allowance);
	printf("\n病假扣款:%lf", E->sick_leave_deduction);
	printf("\n事假扣款:%lf", E->personal_leave_deduction);
	printf("\n旷工扣款:%lf", E->absenteism_deduction);
	printf("\n其它扣款:%lf", E->other_deductions);
	printf("\n实发工资:%lf", E->net_payroll);
	
	//职工出勤
	printf("\n职工的出勤日数:%d", E->attendance_days);
	printf("\n公伤日数:%d", E->injured_days);
	printf("\n产假日数:%d", E->materniy_leave_days);
	printf("\n病假日数:%d", E->Sick_days);
	printf("\n旷工日数:%d", E->absenteism_days);
	printf("\n事假日数:%d", E->personal_leave_dayds);
	printf("\n加班日数:%d", E->ovrtime_days);
	printf("\n夜班日数:%d", E->night_duty_days);
	printf("\n病假系数:%d", E->sick_leave_coefficient);
}
